Q and A Junly 2026
Short Questions
Type Size Range byte 1 byte -128 to 127 short 2 bytes -32,768 to 32,767 int 4 bytes -231 to 231-1 long 8 bytes -263 to 263-1 float 4 bytes +-3.4e-38 to +-3.4e+38 double 8 bytes +-1.7e-308 to +-1.7e+308 char 2 bytes 0 to 65,535 (Unicode) boolean 1 bit true or false String is a class (reference type), not primitive
Class: Blueprint or template Object: Instance of class Instance: belongs to object, has default values
Local: declared inside method, no default values
Static: belongs to class, can be called without object
Instance: belongs to object, requires object to call
Feature Method Overloading Method Overriding When occurs? Within same class Between parent-child classes Inheritance required? No Yes Return type rule Can be different Must be same or covariant Access modifier rule Can be different Cannot be more restrictive Annotation used None Override Binding type Compile-time Runtime